
package com.mephi.model.profile;


import com.mephi.interfaces.ConcurrentMap;
import com.mephi.interfaces.Game;
import com.mephi.interfaces.Profile;
import com.mephi.model.Move;


/**
 * A simple implementation of Profile.
 * @author mephisto
 * 1.0 2011-05-26
 */
public class ProfileImpl implements Profile
{

	/**
	 * 
	 * @param name the name to set
	 */
	public ProfileImpl(String name)
	{
		this(name, new ConcurrentGameMapImpl());
	}
	
	/**
	 * 
	 * @param name the name to set
	 * @param gameMap the gameMap to set
	 */
	public ProfileImpl(String name, ConcurrentMap<String,Game<Move>> gameMap)
	{
		setName(name);
		setGameMap(gameMap);
	}
	
	@Override
	public void clearGameMap()
	{
		gameMap = null;	
	}

	@Override
	public ConcurrentMap<String,Game<Move>> getGameMap()
	{
		return gameMap;
	}

	@Override
	public String getName()
	{
		return name;
	}

	@Override
	public void setGameMap(ConcurrentMap<String,Game<Move>> gameMap)
	{
		this.gameMap = gameMap;
	}

	@Override
	public void setName(String name)
	{
		this.name = name;
	}

	
	private String name;
	private ConcurrentMap<String,Game<Move>> gameMap;
}
